Integrand size = 20, antiderivative size = 257 \[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=-\frac {i b^2 (c+d x)^2}{f}+\frac {a^2 (c+d x)^3}{3 d}-\frac {4 i a b (c+d x)^2 \arctan \left (e^{i (e+f x)}\right )}{f}+\frac {2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}+\frac {4 i a b d (c+d x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {4 i a b d (c+d x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2}-\frac {i b^2 d^2 \operatorname {PolyLog}\left (2,-e^{2 i (e+f x)}\right )}{f^3}-\frac {4 a b d^2 \operatorname {PolyLog}\left (3,-i e^{i (e+f x)}\right )}{f^3}+\frac {4 a b d^2 \operatorname {PolyLog}\left (3,i e^{i (e+f x)}\right )}{f^3}+\frac {b^2 (c+d x)^2 \tan (e+f x)}{f} \]
-I*b^2*(d*x+c)^2/f+1/3*a^2*(d*x+c)^3/d-4*I*a*b*(d*x+c)^2*arctan(exp(I*(f*x +e)))/f+2*b^2*d*(d*x+c)*ln(1+exp(2*I*(f*x+e)))/f^2+4*I*a*b*d*(d*x+c)*polyl og(2,-I*exp(I*(f*x+e)))/f^2-4*I*a*b*d*(d*x+c)*polylog(2,I*exp(I*(f*x+e)))/ f^2-I*b^2*d^2*polylog(2,-exp(2*I*(f*x+e)))/f^3-4*a*b*d^2*polylog(3,-I*exp( I*(f*x+e)))/f^3+4*a*b*d^2*polylog(3,I*exp(I*(f*x+e)))/f^3+b^2*(d*x+c)^2*ta n(f*x+e)/f
Time = 1.54 (sec) , antiderivative size = 356, normalized size of antiderivative = 1.39 \[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=\frac {3 a^2 c^2 f^3 x-3 i b^2 d^2 f^2 x^2+3 a^2 c d f^3 x^2+a^2 d^2 f^3 x^3-24 i a b c d f^2 x \arctan \left (e^{i (e+f x)}\right )-12 i a b d^2 f^2 x^2 \arctan \left (e^{i (e+f x)}\right )+6 a b c^2 f^2 \text {arctanh}(\sin (e+f x))+6 b^2 d^2 f x \log \left (1+e^{2 i (e+f x)}\right )+6 b^2 c d f \log (\cos (e+f x))+12 i a b d f (c+d x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )-12 i a b d f (c+d x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )-3 i b^2 d^2 \operatorname {PolyLog}\left (2,-e^{2 i (e+f x)}\right )-12 a b d^2 \operatorname {PolyLog}\left (3,-i e^{i (e+f x)}\right )+12 a b d^2 \operatorname {PolyLog}\left (3,i e^{i (e+f x)}\right )+3 b^2 c^2 f^2 \tan (e+f x)+6 b^2 c d f^2 x \tan (e+f x)+3 b^2 d^2 f^2 x^2 \tan (e+f x)}{3 f^3} \]
(3*a^2*c^2*f^3*x - (3*I)*b^2*d^2*f^2*x^2 + 3*a^2*c*d*f^3*x^2 + a^2*d^2*f^3 *x^3 - (24*I)*a*b*c*d*f^2*x*ArcTan[E^(I*(e + f*x))] - (12*I)*a*b*d^2*f^2*x ^2*ArcTan[E^(I*(e + f*x))] + 6*a*b*c^2*f^2*ArcTanh[Sin[e + f*x]] + 6*b^2*d ^2*f*x*Log[1 + E^((2*I)*(e + f*x))] + 6*b^2*c*d*f*Log[Cos[e + f*x]] + (12* I)*a*b*d*f*(c + d*x)*PolyLog[2, (-I)*E^(I*(e + f*x))] - (12*I)*a*b*d*f*(c + d*x)*PolyLog[2, I*E^(I*(e + f*x))] - (3*I)*b^2*d^2*PolyLog[2, -E^((2*I)* (e + f*x))] - 12*a*b*d^2*PolyLog[3, (-I)*E^(I*(e + f*x))] + 12*a*b*d^2*Pol yLog[3, I*E^(I*(e + f*x))] + 3*b^2*c^2*f^2*Tan[e + f*x] + 6*b^2*c*d*f^2*x* Tan[e + f*x] + 3*b^2*d^2*f^2*x^2*Tan[e + f*x])/(3*f^3)
Time = 0.55 (sec) , antiderivative size = 257, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3042, 4678, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x)^2 \left (a+b \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2dx\) |
\(\Big \downarrow \) 4678 |
\(\displaystyle \int \left (a^2 (c+d x)^2+2 a b (c+d x)^2 \sec (e+f x)+b^2 (c+d x)^2 \sec ^2(e+f x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 (c+d x)^3}{3 d}-\frac {4 i a b (c+d x)^2 \arctan \left (e^{i (e+f x)}\right )}{f}+\frac {4 i a b d (c+d x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2}-\frac {4 i a b d (c+d x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2}-\frac {4 a b d^2 \operatorname {PolyLog}\left (3,-i e^{i (e+f x)}\right )}{f^3}+\frac {4 a b d^2 \operatorname {PolyLog}\left (3,i e^{i (e+f x)}\right )}{f^3}+\frac {2 b^2 d (c+d x) \log \left (1+e^{2 i (e+f x)}\right )}{f^2}+\frac {b^2 (c+d x)^2 \tan (e+f x)}{f}-\frac {i b^2 (c+d x)^2}{f}-\frac {i b^2 d^2 \operatorname {PolyLog}\left (2,-e^{2 i (e+f x)}\right )}{f^3}\) |
((-I)*b^2*(c + d*x)^2)/f + (a^2*(c + d*x)^3)/(3*d) - ((4*I)*a*b*(c + d*x)^ 2*ArcTan[E^(I*(e + f*x))])/f + (2*b^2*d*(c + d*x)*Log[1 + E^((2*I)*(e + f* x))])/f^2 + ((4*I)*a*b*d*(c + d*x)*PolyLog[2, (-I)*E^(I*(e + f*x))])/f^2 - ((4*I)*a*b*d*(c + d*x)*PolyLog[2, I*E^(I*(e + f*x))])/f^2 - (I*b^2*d^2*Po lyLog[2, -E^((2*I)*(e + f*x))])/f^3 - (4*a*b*d^2*PolyLog[3, (-I)*E^(I*(e + f*x))])/f^3 + (4*a*b*d^2*PolyLog[3, I*E^(I*(e + f*x))])/f^3 + (b^2*(c + d *x)^2*Tan[e + f*x])/f
3.1.30.3.1 Defintions of rubi rules used
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 661 vs. \(2 (232 ) = 464\).
Time = 1.38 (sec) , antiderivative size = 662, normalized size of antiderivative = 2.58
method | result | size |
risch | \(\frac {4 a b \,d^{2} \operatorname {polylog}\left (3, i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{3}}-\frac {4 a b \,d^{2} \operatorname {polylog}\left (3, -i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{3}}+a^{2} d c \,x^{2}+a^{2} c^{2} x +\frac {4 b a c d \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{f^{2}}-\frac {4 i b a \,d^{2} \operatorname {polylog}\left (2, i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f^{2}}+\frac {4 i b a \,d^{2} \operatorname {polylog}\left (2, -i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f^{2}}+\frac {4 i b a c d \operatorname {polylog}\left (2, -i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}-\frac {4 i b a c d \operatorname {polylog}\left (2, i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}-\frac {4 i b a \,d^{2} e^{2} \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{3}}-\frac {4 b a c d \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f}+\frac {4 b a c d \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) x}{f}-\frac {4 b a c d \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) e}{f^{2}}+\frac {8 i b a c d e \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}+\frac {a^{2} d^{2} x^{3}}{3}+\frac {a^{2} c^{3}}{3 d}-\frac {i b^{2} d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (f x +e \right )}\right )}{f^{3}}+\frac {2 i b^{2} \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )}+\frac {4 b^{2} d^{2} e \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{3}}+\frac {2 b^{2} c d \ln \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )}{f^{2}}-\frac {4 b^{2} c d \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2}}+\frac {2 b^{2} d^{2} \ln \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right ) x}{f^{2}}-\frac {2 i b^{2} d^{2} x^{2}}{f}-\frac {2 i b^{2} d^{2} e^{2}}{f^{3}}-\frac {2 b a \,d^{2} \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right ) x^{2}}{f}+\frac {2 b a \,d^{2} \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right ) x^{2}}{f}+\frac {2 b \,e^{2} d^{2} a \ln \left (1+i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{3}}-\frac {2 b \,e^{2} d^{2} a \ln \left (1-i {\mathrm e}^{i \left (f x +e \right )}\right )}{f^{3}}-\frac {4 i b^{2} d^{2} e x}{f^{2}}-\frac {4 i b a \,c^{2} \arctan \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f}\) | \(662\) |
-4*a*b*d^2*polylog(3,-I*exp(I*(f*x+e)))/f^3+4*a*b*d^2*polylog(3,I*exp(I*(f *x+e)))/f^3-I*b^2*d^2*polylog(2,-exp(2*I*(f*x+e)))/f^3+4/f^2*b*a*c*d*ln(1- I*exp(I*(f*x+e)))*e-4*I/f^2*b*a*d^2*polylog(2,I*exp(I*(f*x+e)))*x+4*I/f^2* b*a*d^2*polylog(2,-I*exp(I*(f*x+e)))*x+4*I/f^2*b*a*c*d*polylog(2,-I*exp(I* (f*x+e)))-4*I/f^2*b*a*c*d*polylog(2,I*exp(I*(f*x+e)))-4*I/f^3*b*a*d^2*e^2* arctan(exp(I*(f*x+e)))-4/f*b*a*c*d*ln(1+I*exp(I*(f*x+e)))*x+4/f*b*a*c*d*ln (1-I*exp(I*(f*x+e)))*x-4/f^2*b*a*c*d*ln(1+I*exp(I*(f*x+e)))*e-2/f*b*a*d^2* ln(1+I*exp(I*(f*x+e)))*x^2+2/f*b*a*d^2*ln(1-I*exp(I*(f*x+e)))*x^2+2/f^3*b* e^2*d^2*a*ln(1+I*exp(I*(f*x+e)))-2/f^3*b*e^2*d^2*a*ln(1-I*exp(I*(f*x+e)))- 4*I/f^2*b^2*d^2*e*x-4*I/f*b*a*c^2*arctan(exp(I*(f*x+e)))+a^2*d*c*x^2+a^2*c ^2*x+1/3*a^2*d^2*x^3+1/3*a^2/d*c^3+2*I*b^2*(d^2*x^2+2*c*d*x+c^2)/f/(1+exp( 2*I*(f*x+e)))+4/f^3*b^2*d^2*e*ln(exp(I*(f*x+e)))+2/f^2*b^2*c*d*ln(1+exp(2* I*(f*x+e)))-4/f^2*b^2*c*d*ln(exp(I*(f*x+e)))+2/f^2*b^2*d^2*ln(1+exp(2*I*(f *x+e)))*x-2*I/f*b^2*d^2*x^2-2*I/f^3*b^2*d^2*e^2+8*I/f^2*b*a*c*d*e*arctan(e xp(I*(f*x+e)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1056 vs. \(2 (220) = 440\).
Time = 0.37 (sec) , antiderivative size = 1056, normalized size of antiderivative = 4.11 \[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=\text {Too large to display} \]
-1/3*(6*a*b*d^2*cos(f*x + e)*polylog(3, I*cos(f*x + e) + sin(f*x + e)) - 6 *a*b*d^2*cos(f*x + e)*polylog(3, I*cos(f*x + e) - sin(f*x + e)) + 6*a*b*d^ 2*cos(f*x + e)*polylog(3, -I*cos(f*x + e) + sin(f*x + e)) - 6*a*b*d^2*cos( f*x + e)*polylog(3, -I*cos(f*x + e) - sin(f*x + e)) + 3*(2*I*a*b*d^2*f*x + 2*I*a*b*c*d*f - I*b^2*d^2)*cos(f*x + e)*dilog(I*cos(f*x + e) + sin(f*x + e)) + 3*(2*I*a*b*d^2*f*x + 2*I*a*b*c*d*f + I*b^2*d^2)*cos(f*x + e)*dilog(I *cos(f*x + e) - sin(f*x + e)) + 3*(-2*I*a*b*d^2*f*x - 2*I*a*b*c*d*f + I*b^ 2*d^2)*cos(f*x + e)*dilog(-I*cos(f*x + e) + sin(f*x + e)) + 3*(-2*I*a*b*d^ 2*f*x - 2*I*a*b*c*d*f - I*b^2*d^2)*cos(f*x + e)*dilog(-I*cos(f*x + e) - si n(f*x + e)) - 3*(a*b*d^2*e^2 + a*b*c^2*f^2 - b^2*d^2*e - (2*a*b*c*d*e - b^ 2*c*d)*f)*cos(f*x + e)*log(cos(f*x + e) + I*sin(f*x + e) + I) + 3*(a*b*d^2 *e^2 + a*b*c^2*f^2 + b^2*d^2*e - (2*a*b*c*d*e + b^2*c*d)*f)*cos(f*x + e)*l og(cos(f*x + e) - I*sin(f*x + e) + I) - 3*(a*b*d^2*f^2*x^2 - a*b*d^2*e^2 + 2*a*b*c*d*e*f + b^2*d^2*e + (2*a*b*c*d*f^2 + b^2*d^2*f)*x)*cos(f*x + e)*l og(I*cos(f*x + e) + sin(f*x + e) + 1) + 3*(a*b*d^2*f^2*x^2 - a*b*d^2*e^2 + 2*a*b*c*d*e*f - b^2*d^2*e + (2*a*b*c*d*f^2 - b^2*d^2*f)*x)*cos(f*x + e)*l og(I*cos(f*x + e) - sin(f*x + e) + 1) - 3*(a*b*d^2*f^2*x^2 - a*b*d^2*e^2 + 2*a*b*c*d*e*f + b^2*d^2*e + (2*a*b*c*d*f^2 + b^2*d^2*f)*x)*cos(f*x + e)*l og(-I*cos(f*x + e) + sin(f*x + e) + 1) + 3*(a*b*d^2*f^2*x^2 - a*b*d^2*e^2 + 2*a*b*c*d*e*f - b^2*d^2*e + (2*a*b*c*d*f^2 - b^2*d^2*f)*x)*cos(f*x + ...
\[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=\int \left (a + b \sec {\left (e + f x \right )}\right )^{2} \left (c + d x\right )^{2}\, dx \]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1641 vs. \(2 (220) = 440\).
Time = 0.47 (sec) , antiderivative size = 1641, normalized size of antiderivative = 6.39 \[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=\text {Too large to display} \]
1/3*(3*(f*x + e)*a^2*c^2 + (f*x + e)^3*a^2*d^2/f^2 - 3*(f*x + e)^2*a^2*d^2 *e/f^2 + 3*(f*x + e)*a^2*d^2*e^2/f^2 + 3*(f*x + e)^2*a^2*c*d/f - 6*(f*x + e)*a^2*c*d*e/f + 6*a*b*c^2*log(sec(f*x + e) + tan(f*x + e)) + 6*a*b*d^2*e^ 2*log(sec(f*x + e) + tan(f*x + e))/f^2 - 12*a*b*c*d*e*log(sec(f*x + e) + t an(f*x + e))/f + 3*(2*b^2*d^2*e^2 - 4*b^2*c*d*e*f + 2*b^2*c^2*f^2 - 2*((f* x + e)^2*a*b*d^2 - 2*(a*b*d^2*e - a*b*c*d*f)*(f*x + e) + ((f*x + e)^2*a*b* d^2 - 2*(a*b*d^2*e - a*b*c*d*f)*(f*x + e))*cos(2*f*x + 2*e) + (I*(f*x + e) ^2*a*b*d^2 + 2*(-I*a*b*d^2*e + I*a*b*c*d*f)*(f*x + e))*sin(2*f*x + 2*e))*a rctan2(cos(f*x + e), sin(f*x + e) + 1) - 2*((f*x + e)^2*a*b*d^2 - 2*(a*b*d ^2*e - a*b*c*d*f)*(f*x + e) + ((f*x + e)^2*a*b*d^2 - 2*(a*b*d^2*e - a*b*c* d*f)*(f*x + e))*cos(2*f*x + 2*e) + (I*(f*x + e)^2*a*b*d^2 + 2*(-I*a*b*d^2* e + I*a*b*c*d*f)*(f*x + e))*sin(2*f*x + 2*e))*arctan2(cos(f*x + e), -sin(f *x + e) + 1) + 2*((f*x + e)*b^2*d^2 - b^2*d^2*e + b^2*c*d*f + ((f*x + e)*b ^2*d^2 - b^2*d^2*e + b^2*c*d*f)*cos(2*f*x + 2*e) - (-I*(f*x + e)*b^2*d^2 + I*b^2*d^2*e - I*b^2*c*d*f)*sin(2*f*x + 2*e))*arctan2(sin(2*f*x + 2*e), co s(2*f*x + 2*e) + 1) - 2*((f*x + e)^2*b^2*d^2 - 2*(b^2*d^2*e - b^2*c*d*f)*( f*x + e))*cos(2*f*x + 2*e) - (b^2*d^2*cos(2*f*x + 2*e) + I*b^2*d^2*sin(2*f *x + 2*e) + b^2*d^2)*dilog(-e^(2*I*f*x + 2*I*e)) - 4*((f*x + e)*a*b*d^2 - a*b*d^2*e + a*b*c*d*f + ((f*x + e)*a*b*d^2 - a*b*d^2*e + a*b*c*d*f)*cos(2* f*x + 2*e) + (I*(f*x + e)*a*b*d^2 - I*a*b*d^2*e + I*a*b*c*d*f)*sin(2*f*...
\[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=\int { {\left (d x + c\right )}^{2} {\left (b \sec \left (f x + e\right ) + a\right )}^{2} \,d x } \]
Timed out. \[ \int (c+d x)^2 (a+b \sec (e+f x))^2 \, dx=\int {\left (a+\frac {b}{\cos \left (e+f\,x\right )}\right )}^2\,{\left (c+d\,x\right )}^2 \,d x \]